home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 5 / CD-ROM Today - The Disc (Issue 5)(November 1994).ISO / mac / HyperCard stackware / HyperCard Help / HyperCard Help.rsrc / TEXT_130_Reserved Terms.txt < prev    next >
Text File  |  1994-09-21  |  4KB  |  94 lines

  1.  
  2.    RESERVED SIGNS
  3.  
  4. --> invariable, reserved terms and signs...
  5.  
  6.  
  7.  
  8. ΓîÑ2001           Keywords
  9.  
  10.  Keywords are reserved words (they cannot be used as variables, and they are not trappable messages or commands) defining the structure and flow of handlers. They are:
  11.  
  12.   on messageName [param[,param2...]]
  13.   function messageName [param[,param2...]]
  14.   end messageName
  15.  
  16.   pass messageName -- must be the same as the on/function messageName; all incoming parameters will automatically be passed on; execution of the handler will cease here, but the structure must still be completed with an end
  17.   return value -- if a function, the value will be substituted in the calling line; if a handler, the value will go into the Result; execution of the handler will cease here, but the structure must still be completed with an end
  18.   exit messageName | to HyperCard -- execution of the handler (or, if "to HyperCard", all handlers) will cease here, but the structure must still be completed with an end
  19.  
  20.   global var[,var2...]
  21.  
  22.   repeat forever
  23.                 numberOfTimes
  24.                 until condition
  25.                 while condition
  26.                 with var = startNum [down] to endNum
  27.   exit repeat
  28.   next repeat
  29.   end repeat
  30.  
  31.   if ... then ... [else ...]
  32.  
  33.   if ...
  34.   then ...
  35.   [else ...]
  36.  
  37.   if ... then
  38.     ...
  39.   [else
  40.     ...]
  41.   end if
  42.  
  43.   send messageString to HyperCard | objectInThisStack | stack otherStackName -- see Messages for more info. send also has two other uses: (1) for sending a 'dosc' AppleEvent to another program and (2) for running an object script written in another scripting dialect; see Communication for more info.
  44.  
  45.   do expression -- expression can be a string construction, to force evaluation of the whole string before its execution; this is a way to get multiple lines, or special punctuation, into a single line. Or it can be a container, in which case the whole container is executed, line by line. [A bug in earlier versions prevented this second use (you could only "do" a line at a time), but this is now fixed.] do also has another use, for running an expression or contatiner contents written in another scripting dialect; see Communication for more info.
  46.  
  47.  
  48.  
  49. ΓîÑ2001           Operators
  50.  
  51. Operators are reserved symbols and words used for combining "factors" into "expressions". They are given here in order of precedence; there are ten levels, and those on the same level are evaluated right to left. Parenthesised expressions are evaluated from inmost outwards.
  52.  
  53. ()
  54. - [negative number]   not   there is {[not] a[n]} | no
  55. ^
  56. *   /   div   mod
  57. +   -
  58. &   &&
  59. <   >   <=   Γëñ   >=   ΓëÑ   contains   is [not] a[n] | in | within
  60. =   is   is not   <>   Γëá
  61. and
  62. or
  63.  
  64. Notes: "within" is for rects, "in" is for strings. "There is" can be followed by cd pict, bg pict, or any of the following (plus a further specifier): scriptingLanguage, program [ID], disk, folder, application, document, file, stack, menu, menuItem, window, cd, bg, fld, btn, part. ("Program" means a currently running program.) "Is a" can be followed by number, integer, point, rect, date, logical.
  65.  
  66.  
  67.  
  68. ΓîÑ2001           Constants
  69.  
  70. Constants are reserved words standing in the same syntax as variables, except that they cannot have anything put into them; they have pre-defined literal values.
  71.  
  72. colon comma space tab return quote empty
  73. true false up down
  74. eof formfeed linefeed
  75. pi zero..ten
  76.  
  77.  
  78.  
  79. ΓîÑ2001           Objects and Chunks
  80.  
  81. These are terms for referring to objects and parts of objects and containers.
  82.  
  83.   stack bg cd part fld btn
  84.   me -- reference to the object containing the currently executing handler; with select and a field you may need to use text of me to distinguish the contents from the field itself
  85.   the target -- also, the long target, the short target. Reference to the object to which the current message was originally sent; for the format, see chapter "Properties II" under "Name" of object-type. Under some circumstances with a button or field you may need to use target (without "the") to mean the contents.
  86.   the result -- returned by "return" in a message handler, or with an error-message if certain operations fail (so that checking "the result is empty" can indicate success), or can be set by an XCMD; reset to "empty" after the next command executes, so check it first thing
  87.   it
  88.   char word item line
  89.   any first last middle second third fourth fifth sixth seventh eighth ninth tenth
  90.   next prev this
  91.   id
  92.   msg
  93.  
  94.